/**
 * @author scylla
 * @version V1.0
 * @Project echo-java-base
 * @Title 带返回结果的任务
 * @Description *
 * @Package concurrent.mthread.callable
 * @Since 2021/7/27 10:08 上午
 */
package concurrent.mthread.callable;

import java.text.MessageFormat;
import java.util.concurrent.Callable;

public class TaskWithResult implements Callable<String> {

    private int id;

    public TaskWithResult(int id) {
        this.id = id;
    }

    /**
     * 返回调用
     *
     * @return {@link String}
     * @author chentl
     * @since 10:10 上午 2021/7/27
     **/
    @Override
    public String call() {
        return MessageFormat.format("{0} result of TaskWithResult : {1}", Thread.currentThread().getName(), id);
    }


}
